/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package blueprint4j.db;

import blueprint4j.Constants;

public class FieldGroupPerson extends FieldGroup {
	public FieldString title = null;
	public FieldString first_name = null;
	public FieldString initials = null;
	public FieldString last_name = null;
	public FieldDate date_of_birth = null;

	public FieldGroupPerson(String name,Entity entity) {
		super(name,Constants.ICON_BASE+"actions/identity.png",entity);
		title = new FieldString("title",0,"Title", 5,entity);
		first_name = new FieldString("first_name",Field.FIELD_NAME,"First Name", 50,entity);
		initials = new FieldString("initials",0,"Initials", 10,entity);
		last_name = new FieldString("last_name",Field.FIELD_NAME,"Last Name", 50,entity);
		date_of_birth = new FieldDate("date_of_birth",0,"Date Of Birth", entity);
	}
	
	
	public String toString(){
		String fn=first_name.get();
		String ln=last_name.get();
		return (fn!=null?fn+" ":"")+(ln!=null?ln:"");
	}

}

